package com.chaoyong.higo.activity;

import java.util.ArrayList;

import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.StaggeredGridLayoutManager;
import android.view.View;
import android.widget.LinearLayout;

import com.chaoyong.higo.R;
import com.chaoyong.higo.adapter.WinningNoAdapter;
import com.chaoyong.higo.base.BaseActivity;

public class WinningNoActivity extends BaseActivity {

	private RecyclerView recyclerView;
	private ArrayList<Integer> datas;
	private WinningNoAdapter adapter;
	private LinearLayout back;
	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
		case R.id.back_btn:
			finish();
			break;

		default:
			break;
		}
	}

	@Override
	public int layoutResID() {
		// TODO Auto-generated method stub
		return R.layout.activity_winning_no;
	}

	@Override
	public void findView() {
		// TODO Auto-generated method stub
		recyclerView = (RecyclerView) findViewById(R.id.winning_no_recycler);
		back = (LinearLayout) findViewById(R.id.back_btn);
	}

	@Override
	public void init() {
		// TODO Auto-generated method stub
		datas = getIntent().getIntegerArrayListExtra("datas");
		
		back.setOnClickListener(this);
		
		adapter = new WinningNoAdapter(this, datas);
		recyclerView.setLayoutManager(new StaggeredGridLayoutManager(4, StaggeredGridLayoutManager.VERTICAL));
		recyclerView.setAdapter(adapter);
	}

}
